//利用闭包的方法封装防抖动函数
export function debounce1(fn, delay = 200) {
  let timer = null
  return function (...ares) {
    let _this = this
    if (timer) {
      clearTimeout(timer)
    }

    timer = setTimeout(() => {
      fn.apply(_this, ares)
      timer = null
    }, delay)
  }
}